<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Newton Dynamics: nd::TiXmlHandle Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo_php.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Newton Dynamics
   &#160;<span id="projectnumber">4.00</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classnd_1_1_ti_xml_handle.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classnd_1_1_ti_xml_handle-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">nd::TiXmlHandle Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A <a class="el" href="classnd_1_1_ti_xml_handle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thi...">TiXmlHandle</a> is a class that wraps a node pointer with null checks; this is an incredibly useful thing.  
 <a href="classnd_1_1_ti_xml_handle.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a45cef1e68080e990f57bb0fa8bf89582"><td class="memItemLeft" align="right" valign="top"><a id="a45cef1e68080e990f57bb0fa8bf89582"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a45cef1e68080e990f57bb0fa8bf89582">TiXmlHandle</a> (<a class="el" href="classnd_1_1_ti_xml_node.html">TiXmlNode</a> *_node)</td></tr>
<tr class="memdesc:a45cef1e68080e990f57bb0fa8bf89582"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a handle from any node (at any depth of the tree.) This can be a null pointer. <br /></td></tr>
<tr class="separator:a45cef1e68080e990f57bb0fa8bf89582"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34d8330d5fba28f330c2e7b5b1a0375c"><td class="memItemLeft" align="right" valign="top"><a id="a34d8330d5fba28f330c2e7b5b1a0375c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a34d8330d5fba28f330c2e7b5b1a0375c">TiXmlHandle</a> (const <a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a> &amp;ref)</td></tr>
<tr class="memdesc:a34d8330d5fba28f330c2e7b5b1a0375c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor. <br /></td></tr>
<tr class="separator:a34d8330d5fba28f330c2e7b5b1a0375c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af37c06902b384ea71b166e27337e5dee"><td class="memItemLeft" align="right" valign="top"><a id="af37c06902b384ea71b166e27337e5dee"></a>
void *&#160;</td><td class="memItemRight" valign="bottom"><b>operator new</b> (size_t size)</td></tr>
<tr class="separator:af37c06902b384ea71b166e27337e5dee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86ff593723e7f2f6cbbdf34a348e08eb"><td class="memItemLeft" align="right" valign="top"><a id="a86ff593723e7f2f6cbbdf34a348e08eb"></a>
void *&#160;</td><td class="memItemRight" valign="bottom"><b>operator new[]</b> (size_t size)</td></tr>
<tr class="separator:a86ff593723e7f2f6cbbdf34a348e08eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d4276412fd239d2341a544496bb7874"><td class="memItemLeft" align="right" valign="top"><a id="a7d4276412fd239d2341a544496bb7874"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>operator delete</b> (void *ptr)</td></tr>
<tr class="separator:a7d4276412fd239d2341a544496bb7874"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69ee6d9e6b3444498475d1695e541487"><td class="memItemLeft" align="right" valign="top"><a id="a69ee6d9e6b3444498475d1695e541487"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>operator delete[]</b> (void *ptr)</td></tr>
<tr class="separator:a69ee6d9e6b3444498475d1695e541487"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac96bd3e24c4bb5062e82ec1a836f5037"><td class="memItemLeft" align="right" valign="top"><a id="ac96bd3e24c4bb5062e82ec1a836f5037"></a>
<a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a> &amp;ref)</td></tr>
<tr class="separator:ac96bd3e24c4bb5062e82ec1a836f5037"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7f68f3c3d79d1fc7483cf180cfd4cd2"><td class="memItemLeft" align="right" valign="top"><a id="ab7f68f3c3d79d1fc7483cf180cfd4cd2"></a>
<a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#ab7f68f3c3d79d1fc7483cf180cfd4cd2">FirstChild</a> () const</td></tr>
<tr class="memdesc:ab7f68f3c3d79d1fc7483cf180cfd4cd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a handle to the first child node. <br /></td></tr>
<tr class="separator:ab7f68f3c3d79d1fc7483cf180cfd4cd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af24fd80db1b9d87f3f00c62b3424d2b9"><td class="memItemLeft" align="right" valign="top"><a id="af24fd80db1b9d87f3f00c62b3424d2b9"></a>
<a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#af24fd80db1b9d87f3f00c62b3424d2b9">FirstChild</a> (const char *value) const</td></tr>
<tr class="memdesc:af24fd80db1b9d87f3f00c62b3424d2b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a handle to the first child node with the given name. <br /></td></tr>
<tr class="separator:af24fd80db1b9d87f3f00c62b3424d2b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e29008dadbae12d3fc082ac4ab8fff1"><td class="memItemLeft" align="right" valign="top"><a id="a7e29008dadbae12d3fc082ac4ab8fff1"></a>
<a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a7e29008dadbae12d3fc082ac4ab8fff1">FirstChildElement</a> () const</td></tr>
<tr class="memdesc:a7e29008dadbae12d3fc082ac4ab8fff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a handle to the first child element. <br /></td></tr>
<tr class="separator:a7e29008dadbae12d3fc082ac4ab8fff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54b8aaa17ca360a2b55aeb401e38770b"><td class="memItemLeft" align="right" valign="top"><a id="a54b8aaa17ca360a2b55aeb401e38770b"></a>
<a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a54b8aaa17ca360a2b55aeb401e38770b">FirstChildElement</a> (const char *value) const</td></tr>
<tr class="memdesc:a54b8aaa17ca360a2b55aeb401e38770b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a handle to the first child element with the given name. <br /></td></tr>
<tr class="separator:a54b8aaa17ca360a2b55aeb401e38770b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c50607cf48472b3b253af7377f358e6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a5c50607cf48472b3b253af7377f358e6">Child</a> (const char *value, int index) const</td></tr>
<tr class="memdesc:a5c50607cf48472b3b253af7377f358e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a handle to the "index" child with the given name.  <a href="classnd_1_1_ti_xml_handle.html#a5c50607cf48472b3b253af7377f358e6">More...</a><br /></td></tr>
<tr class="separator:a5c50607cf48472b3b253af7377f358e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83a26ec5ecbc09cdd516ad967bf06345"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a83a26ec5ecbc09cdd516ad967bf06345">Child</a> (int index) const</td></tr>
<tr class="memdesc:a83a26ec5ecbc09cdd516ad967bf06345"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a handle to the "index" child.  <a href="classnd_1_1_ti_xml_handle.html#a83a26ec5ecbc09cdd516ad967bf06345">More...</a><br /></td></tr>
<tr class="separator:a83a26ec5ecbc09cdd516ad967bf06345"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e0ded198d14a08b3aca50f0f95acaff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a5e0ded198d14a08b3aca50f0f95acaff">ChildElement</a> (const char *value, int index) const</td></tr>
<tr class="memdesc:a5e0ded198d14a08b3aca50f0f95acaff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a handle to the "index" child element with the given name.  <a href="classnd_1_1_ti_xml_handle.html#a5e0ded198d14a08b3aca50f0f95acaff">More...</a><br /></td></tr>
<tr class="separator:a5e0ded198d14a08b3aca50f0f95acaff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae71825fb9d13804a6498d99316f85ada"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#ae71825fb9d13804a6498d99316f85ada">ChildElement</a> (int index) const</td></tr>
<tr class="memdesc:ae71825fb9d13804a6498d99316f85ada"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a handle to the "index" child element.  <a href="classnd_1_1_ti_xml_handle.html#ae71825fb9d13804a6498d99316f85ada">More...</a><br /></td></tr>
<tr class="separator:ae71825fb9d13804a6498d99316f85ada"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5771d279f54b0bd8f85eb4c675eb115"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_node.html">TiXmlNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#aa5771d279f54b0bd8f85eb4c675eb115">ToNode</a> () const</td></tr>
<tr class="memdesc:aa5771d279f54b0bd8f85eb4c675eb115"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the handle as a <a class="el" href="classnd_1_1_ti_xml_node.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>.  <a href="classnd_1_1_ti_xml_handle.html#aa5771d279f54b0bd8f85eb4c675eb115">More...</a><br /></td></tr>
<tr class="separator:aa5771d279f54b0bd8f85eb4c675eb115"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7412953c9e7fb0f34af2675f34f860fe"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_element.html">TiXmlElement</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a7412953c9e7fb0f34af2675f34f860fe">ToElement</a> () const</td></tr>
<tr class="memdesc:a7412953c9e7fb0f34af2675f34f860fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the handle as a <a class="el" href="classnd_1_1_ti_xml_element.html" title="The element is a container class.">TiXmlElement</a>.  <a href="classnd_1_1_ti_xml_handle.html#a7412953c9e7fb0f34af2675f34f860fe">More...</a><br /></td></tr>
<tr class="separator:a7412953c9e7fb0f34af2675f34f860fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa56ce49506227ab9f816347f74b02128"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_text.html">TiXmlText</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#aa56ce49506227ab9f816347f74b02128">ToText</a> () const</td></tr>
<tr class="memdesc:aa56ce49506227ab9f816347f74b02128"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the handle as a <a class="el" href="classnd_1_1_ti_xml_text.html" title="XML text.">TiXmlText</a>.  <a href="classnd_1_1_ti_xml_handle.html#aa56ce49506227ab9f816347f74b02128">More...</a><br /></td></tr>
<tr class="separator:aa56ce49506227ab9f816347f74b02128"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a899e174f7765ae4e7447c29093ac8899"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_unknown.html">TiXmlUnknown</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a899e174f7765ae4e7447c29093ac8899">ToUnknown</a> () const</td></tr>
<tr class="memdesc:a899e174f7765ae4e7447c29093ac8899"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the handle as a <a class="el" href="classnd_1_1_ti_xml_unknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>.  <a href="classnd_1_1_ti_xml_handle.html#a899e174f7765ae4e7447c29093ac8899">More...</a><br /></td></tr>
<tr class="separator:a899e174f7765ae4e7447c29093ac8899"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a79b99528fb7f5de614103c63860f0295"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_node.html">TiXmlNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a79b99528fb7f5de614103c63860f0295">Node</a> () const</td></tr>
<tr class="separator:a79b99528fb7f5de614103c63860f0295"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac009a05ec66b79d4f6a556d80294330c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_element.html">TiXmlElement</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#ac009a05ec66b79d4f6a556d80294330c">Element</a> () const</td></tr>
<tr class="separator:ac009a05ec66b79d4f6a556d80294330c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfa3862b1974013cd712177b4f4f75eb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_text.html">TiXmlText</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#adfa3862b1974013cd712177b4f4f75eb">Text</a> () const</td></tr>
<tr class="separator:adfa3862b1974013cd712177b4f4f75eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39c7b9067f91f6e9e0949730d6ed9c24"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnd_1_1_ti_xml_unknown.html">TiXmlUnknown</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnd_1_1_ti_xml_handle.html#a39c7b9067f91f6e9e0949730d6ed9c24">Unknown</a> () const</td></tr>
<tr class="separator:a39c7b9067f91f6e9e0949730d6ed9c24"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A <a class="el" href="classnd_1_1_ti_xml_handle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thi...">TiXmlHandle</a> is a class that wraps a node pointer with null checks; this is an incredibly useful thing. </p>
<p>Note that <a class="el" href="classnd_1_1_ti_xml_handle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thi...">TiXmlHandle</a> is not part of the TinyXml DOM structure. It is a separate utility class.</p>
<p>Take an example: </p><pre class="fragment">&lt;Document&gt;
    &lt;Element attributeA = "valueA"&gt;
        &lt;Child attributeB = "value1" /&gt;
        &lt;Child attributeB = "value2" /&gt;
    &lt;/Element&gt;
&lt;Document&gt;
</pre><p>Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very easy to write a <em>lot</em> of code that looks like:</p>
<pre class="fragment">TiXmlElement* root = document.FirstChildElement( "Document" );
if ( root )
{
    TiXmlElement* element = root-&gt;FirstChildElement( "Element" );
    if ( element )
    {
        TiXmlElement* child = element-&gt;FirstChildElement( "Child" );
        if ( child )
        {
            TiXmlElement* child2 = child-&gt;NextSiblingElement( "Child" );
            if ( child2 )
            {
                // Finally do something useful.
</pre><p>And that doesn't even cover "else" cases. <a class="el" href="classnd_1_1_ti_xml_handle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thi...">TiXmlHandle</a> addresses the verbosity of such code. A <a class="el" href="classnd_1_1_ti_xml_handle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thi...">TiXmlHandle</a> checks for null pointers so it is perfectly safe and correct to use:</p>
<pre class="fragment">TiXmlHandle docHandle( &amp;document );
TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
if ( child2 )
{
    // do something useful
</pre><p>Which is MUCH more concise and useful.</p>
<p>It is also safe to copy handles - internally they are nothing more than node pointers. </p><pre class="fragment">TiXmlHandle handleCopy = handle;
</pre><p>What they should not be used for is iteration:</p>
<pre class="fragment">int i=0; 
while ( true )
{
    TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement();
    if ( !child )
        break;
    // do something
    ++i;
}
</pre><p>It seems reasonable, but it is in fact two embedded while loops. The Child method is a linear walk to find the element, so this code would iterate much more than it needs to. Instead, prefer:</p>
<pre class="fragment">TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement();

for( child; child; child=child-&gt;NextSiblingElement() )
{
    // do something
}
</pre> </div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a5c50607cf48472b3b253af7377f358e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c50607cf48472b3b253af7377f358e6">&#9670;&nbsp;</a></span>Child() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a> nd::TiXmlHandle::Child </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return a handle to the "index" child with the given name. </p>
<p>The first child is 0, the second 1, etc. </p>

</div>
</div>
<a id="a83a26ec5ecbc09cdd516ad967bf06345"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a83a26ec5ecbc09cdd516ad967bf06345">&#9670;&nbsp;</a></span>Child() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a> nd::TiXmlHandle::Child </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return a handle to the "index" child. </p>
<p>The first child is 0, the second 1, etc. </p>

</div>
</div>
<a id="a5e0ded198d14a08b3aca50f0f95acaff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e0ded198d14a08b3aca50f0f95acaff">&#9670;&nbsp;</a></span>ChildElement() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a> nd::TiXmlHandle::ChildElement </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return a handle to the "index" child element with the given name. </p>
<p>The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. </p>

</div>
</div>
<a id="ae71825fb9d13804a6498d99316f85ada"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae71825fb9d13804a6498d99316f85ada">&#9670;&nbsp;</a></span>ChildElement() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a> nd::TiXmlHandle::ChildElement </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return a handle to the "index" child element. </p>
<p>The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. </p>

</div>
</div>
<a id="ac009a05ec66b79d4f6a556d80294330c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac009a05ec66b79d4f6a556d80294330c">&#9670;&nbsp;</a></span>Element()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_element.html">TiXmlElement</a>* nd::TiXmlHandle::Element </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>use ToElement. Return the handle as a <a class="el" href="classnd_1_1_ti_xml_element.html" title="The element is a container class.">TiXmlElement</a>. This may return null. </dd></dl>

</div>
</div>
<a id="a79b99528fb7f5de614103c63860f0295"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79b99528fb7f5de614103c63860f0295">&#9670;&nbsp;</a></span>Node()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_node.html">TiXmlNode</a>* nd::TiXmlHandle::Node </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>use ToNode. Return the handle as a <a class="el" href="classnd_1_1_ti_xml_node.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>. This may return null. </dd></dl>

</div>
</div>
<a id="adfa3862b1974013cd712177b4f4f75eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adfa3862b1974013cd712177b4f4f75eb">&#9670;&nbsp;</a></span>Text()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_text.html">TiXmlText</a>* nd::TiXmlHandle::Text </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000003">Deprecated:</a></b></dt><dd>use <a class="el" href="classnd_1_1_ti_xml_handle.html#aa56ce49506227ab9f816347f74b02128" title="Return the handle as a TiXmlText.">ToText()</a> Return the handle as a <a class="el" href="classnd_1_1_ti_xml_text.html" title="XML text.">TiXmlText</a>. This may return null. </dd></dl>

</div>
</div>
<a id="a7412953c9e7fb0f34af2675f34f860fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7412953c9e7fb0f34af2675f34f860fe">&#9670;&nbsp;</a></span>ToElement()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_element.html">TiXmlElement</a>* nd::TiXmlHandle::ToElement </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the handle as a <a class="el" href="classnd_1_1_ti_xml_element.html" title="The element is a container class.">TiXmlElement</a>. </p>
<p>This may return null. </p>

</div>
</div>
<a id="aa5771d279f54b0bd8f85eb4c675eb115"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5771d279f54b0bd8f85eb4c675eb115">&#9670;&nbsp;</a></span>ToNode()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_node.html">TiXmlNode</a>* nd::TiXmlHandle::ToNode </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the handle as a <a class="el" href="classnd_1_1_ti_xml_node.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>. </p>
<p>This may return null. </p>

</div>
</div>
<a id="aa56ce49506227ab9f816347f74b02128"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa56ce49506227ab9f816347f74b02128">&#9670;&nbsp;</a></span>ToText()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_text.html">TiXmlText</a>* nd::TiXmlHandle::ToText </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the handle as a <a class="el" href="classnd_1_1_ti_xml_text.html" title="XML text.">TiXmlText</a>. </p>
<p>This may return null. </p>

</div>
</div>
<a id="a899e174f7765ae4e7447c29093ac8899"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a899e174f7765ae4e7447c29093ac8899">&#9670;&nbsp;</a></span>ToUnknown()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_unknown.html">TiXmlUnknown</a>* nd::TiXmlHandle::ToUnknown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the handle as a <a class="el" href="classnd_1_1_ti_xml_unknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>. </p>
<p>This may return null. </p>

</div>
</div>
<a id="a39c7b9067f91f6e9e0949730d6ed9c24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39c7b9067f91f6e9e0949730d6ed9c24">&#9670;&nbsp;</a></span>Unknown()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnd_1_1_ti_xml_unknown.html">TiXmlUnknown</a>* nd::TiXmlHandle::Unknown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000004">Deprecated:</a></b></dt><dd>use <a class="el" href="classnd_1_1_ti_xml_handle.html#a899e174f7765ae4e7447c29093ac8899" title="Return the handle as a TiXmlUnknown.">ToUnknown()</a> Return the handle as a <a class="el" href="classnd_1_1_ti_xml_unknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>. This may return null. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>nd</b></li><li class="navelem"><a class="el" href="classnd_1_1_ti_xml_handle.html">TiXmlHandle</a></li>
    <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
  </ul>
</div>
</body>
</html>
